#define gas_sensor_Variable

#include "userDef.h"

#ifdef GAS_SENSOR
void gas_sensor_check(void) // called in systime.c per 1s
{
    static U8 count_leak = 0;
    static U8 count_sensor = 0;

    if (PowerOnMin > 1)
    {
        if (f_GasLeakErr == OFF)
        {
            if (IO_GASDO == OFF && count_leak < 5)
            {
                count_leak++;

                if (count_leak >= 5)
                {
                    f_GasLeakErr = ON;

                    timer_FoRecall_Run = 0;
                    f_FoRecall = 1;
                    stat_FoRecall = 1;
                }
            }
            else
            {
                count_leak = 0;
            }
        }

        if (f_GasSensorErr == OFF)
        {
            if (IO_GASFO == OFF && count_sensor < 5)
            {
                count_sensor++;

                if (count_sensor >= 5)
                {
                    f_GasSensorErr = ON;
                }
            }
            else
            {
                count_sensor = 0;
            }
        }
    }
}
#endif
